import React from 'react';
// v6版本的使用
import { BrowserRouter as Router, Routes, Route, Link } from "react-router-dom";
import Index from "./Pages/Index";
import List from "./Pages/List";
import Home from "./Pages/Home";

function AppRouter() {
    return (
        <Router>
            <ul>
                <li><Link to="/">首页</Link></li>
                <li><Link to="/list/">列表</Link></li>
            </ul>
            <Routes>
                <Route path='/' exact element={<Index />}></Route>
                <Route path='/list/:id' element={<List />}></Route>
                <Route path='/home/' element={<Home />}></Route>
            </Routes>
        </Router>
    )
}

export default AppRouter;